from django.db import models

# Create your models here.

class CallCircuit(models.Model):
    '''
    业务线表
    '''
    Name = models.CharField(max_length=30)

    # admin声明表名
    class Meta:
        verbose_name_plural = "业务线表"

    def __str__(self):
        return self.Name

class Hosts(models.Model):
    '''
    主机表
    '''
    Name = models.CharField(max_length=30)
    IP = models.GenericIPAddressField()
    CPU = models.IntegerField()
    Mem = models.IntegerField()
    ctime = models.DateTimeField(verbose_name='时间', auto_now_add=True)
    update_date = models.DateTimeField(blank=True, auto_now=True)
    callCircuit = models.ForeignKey("CallCircuit", blank=True, null=True)

    # admin声明表名
    class Meta:
        verbose_name_plural = "主机表"

    def __str__(self):
        return self.Name